#include<stdio.h>
int main()
{
	int n,a=0,b=0,c;
	scanf("%d",&n);
	while(1)
	{
		a++;
		c=a;
		for(b=1;b<=n;b++)
		{
			if((c-1)%n==0&&c>n)
			{
				c=c-1-(c-1)/n;
			}
			else break;
		}
		if(b-1==n)
		break;
	}
	printf("%d\n",a);
	for(b=1;b<=n;b++)
	{
		c=(a-1)/n;
		a=a-1-(a-1)/n;
		printf("%d\n",c);
	}
	return 0;
} 
